import java.util.List;
import java.util.LinkedList;

public class EBNFClass{
    private List<SintaxRule> sr;
    private String id;
    private List<Simbol> simbols;

    public EBNFClass (){
	this.sr=new LinkedList<SintaxRule>();
	this.id="";
    }
    
    public EBNFClass(String id){
	this.id=id;
	this.sr=new LinkedList<SintaxRule>();
	this.simbols=new LinkedList<Simbol>();
    }

    public EBNFClass(String id, List<SintaxRule> sr){
	this.id=id;
	this.sr=sr;
	this.simbols=new LinkedList<Simbol>();
    }
    
    public EBNFClass(String id, List<Simbol> simbols, List<SintaxRule> sr){
	this.id=id;
	this.sr=sr;
	this.simbols=simbols;
    }

    public List<Simbol> getSimbols(){
	return this.simbols;
    }

    public List<SintaxRule> getSintaxRule(){
	return this.sr;
    }

    public String getId(){
	return this.id;
    }

    public void setId(String id){
	this.id=id;
    }

    public void addSR(SintaxRule s){
	this.sr.add(s);
    }

    public void addSimbol(Simbol s){
	this.simbols.add(s);
    }

    public void setType(String type){
	for(int i=0;i<simbols.size();i++)
	    simbols.get(i).setType(type);
    }
    
    public void addSimbols(EBNFClass e2){
	for(int i=0;i<e2.getSimbols().size();i++)
	    this.addSimbol(e2.getSimbols().get(i));
    }

    @Override public String toString(){
	return "" + getId() + "\n";
    }
}